#! -*-coding:utf-8 -*-
#默认提供4套环境 DEV,TEST,PRO,BASE
#环境需要自定义配置
ENV = 'DEV'


def env_active(env):
    if env == 'DEV':
        return DevSettings()
    elif env == 'TEST':
        return TestSettings()
    elif env == 'PRO':
        return ProductSettings()
    else:
        return BaseSettings()


class BaseSettings:
    ENV = 'BASE'
    SECRET_KEY = 'flask_scret_key'
    DEBUG = True
    RELOAD = True
    HOST = '127.0.0.1'
    PORT = 8080

    #日志文件夹名称
    LOG_DIR_NAME = 'logs'

    #数据库配置
    SQLALCHEMY_DATABASE_URI = 'sqlite:///../data.sqlite'
    SQLALCHEMY_TRACK_MODIFICATIONS = False

    #session配置
    SESSION_TYPE = 'sqlalchemy'
    SESSION_SQLALCHEMY_TABLE = 'app_session'


class DevSettings(BaseSettings):
    ENV = 'DEV'
   


class TestSettings(BaseSettings):
    ENV = 'TEST'
 


class ProductSettings(BaseSettings):
    ENV = 'PRO'



real_env = env_active(ENV)
